package com.csii.activiti.server.core.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ActFlowDataManageConstant {

    /**
     * 审核中
     */
    UNDER_REVIEW("underReview", "审核中"),

    /**
     * 已通过
     */
    PASSED("passed", "已通过"),

    /**
     * 已驳回
     */
    REJECTED("rejected", "已驳回"),

    /**
     * 已撤回
     */
    WITHDRAWN("withdrawn", "已撤回"),
    ;


    private String status;
    private String description;

    public static ActFlowDataManageConstant getStatus(String description){
        for (ActFlowDataManageConstant value : values()) {
            if (value.description.equals(description)) {
                return value;
            }
        }
        return null;
    }

    public static ActFlowDataManageConstant getDescription(String status){
        for (ActFlowDataManageConstant value : values()) {
            if (value.status.equals(status)) {
                return value;
            }
        }
        return null;
    }
}
